<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>background-size背景尺寸</title>
  <style>
    /* 背景八大  -  css3 */
    div {
      float:left;
      margin:20px;
      width:50px;
      height:50px;
    }
    /* px  %  cover contain auto 
    cover - 宽度 + 高度 - 50 * 50   裁剪
    contain -  宽度 / 宽度  - 留白

    容器比例   =  图片素材比例   雪碧图:宽度 高度
    rem + px 

    */
    .box1{
       background:#000 url(images/icon-wechat.png) no-repeat center;
       background-size: contain;
    }
    .box2{
       background:#000 url(images/icon-rp.png) no-repeat center;
       background-size: contain;
    }
    .box3{
       background:#000 url(images/icon-credit.png) no-repeat center;
       background-size: contain;
    }
  </style>
</head>

<body>

  <div class="box1"></div>

  <div class="box2"></div>

  <div class="box3"></div>

  <div class="box4"></div>
  <br>
  <div class="box5"></div>

</body>

</html>